package com.gopay.common.domain.cbrmb.exchange;

import java.io.Serializable;

public class ResponseT<T> implements Serializable {

	private static final long serialVersionUID = -6434072243454644039L;
	public static final int SUCCESS_CODE = 200;
	
	public static final int FAIL_CODE = 500;
	public static final ResponseT<String> FAIL = new ResponseT<String>(FAIL_CODE, null);

	private int code;

	private String msg;

	private T content;

	public ResponseT() {
	}

	public ResponseT(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public ResponseT(T content) {
		this.code = SUCCESS_CODE;
		this.content = content;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public T getContent() {
		return content;
	}

	public void setContent(T content) {
		this.content = content;
	}

	@Override
	public String toString() {
		return "ResponseT [code=" + code + ", msg=" + msg + ", content=" + content + "]";
	}

}
